#ifndef __EPSILON__QUARTZ__WINDOW_H__
#define __EPSILON__QUARTZ__WINDOW_H__

#include <Carbon/Carbon.h>

/**
 * Information specific to Quartz windows.
 *
 */
class eWindowParametersQuartz : public eWindowParameters {
public:
  /// Default constructor
  eWindowParametersQuartz (void) {
    eWindowParameters ();

    flags   |= E_WF_QUARTZ;
  }

  // TODO
};

/**
 * API specific window internals (Quartz)
 *
 */
class eWindowQuartz : eWindowInternals {
  friend class eEngine;
  friend class eWindow;
protected:

  bool create   (const eWindowParameters& parameters, eWindow* window); ///< Create the window and perform default initialization
  bool recreate (const eWindowParameters& parameters);                  ///< Recreate the window (that is, change render context properties on the fly...)
  bool destroy  (void);                                                 ///< Destroy the window and perform all cleanup

  void move          (const int& left, const int& top); ///< Move the window to the specified left and top coordinates
  void move_client   (const int& left, const int& top); ///< Move the client region of the window
  void resize        (const int& x,    const int& y);   ///< Resize the window to the specified x and y dimensions
  void resize_client (const int& x,    const int& y);   ///< Resize the client region of the window

  void show          (int cmd);                         ///< Allows you to show or hide the window.

  void update_rect   (void);                            ///< Causes the engine to requery the dimensions from the Window Manager...

  void show_cursor    (bool show);                      ///< Show or Hide the Window Manager's cursor.
  void set_cursor_pos (int x, int y);                   ///< Set the WM's logical cursor pos, from client coords.

  pascal OSStatus
      InternalEventHandler (EventHandlerCallRef handler,
		            EventRef            event);

  static pascal OSStatus
      GlobalEventHandler (EventHandlerCallRef handler,
	                  EventRef            event,
		   	  void*               pUserData);


  const eWindowHandle
       getNativeWindowHandle (void); ///< Returns an Quartz window handle.

  static void Think (void); ///< Handle the Quartz Message Pump

  
  WindowRef wndref;
};

#endif /* __EPSILON__QUARTZ__WINDOW_H__ */
